function [fitresult, gof] = createFit(NT, N)
%CREATEFIT(NT,N)
%  Create a fit.
%
%  Data for 'untitled fit 1' fit:
%      X Input : NT
%      Y Output: N
%  Output:
%      fitresult : a fit object representing the fit.
%      gof : structure with goodness-of fit info.
%
%  See also FIT, CFIT, SFIT.

%  Auto-generated by MATLAB on 27-Sep-2021 12:05:27


%% Fit: 'untitled fit 1'.
[xData, yData] = prepareCurveData( NT, N );

% Set up fittype and options.
ft = fittype( 'gauss3' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.Lower = [-Inf -Inf 0 -Inf -Inf 0 -Inf -Inf 0];
opts.StartPoint = [6213 -0.1 0.0844990904328781 3023.07486745615 0.1 0.119954543341823 2282.95519806891 0.5 0.176787578858148];

% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );

% Plot fit with data.
figure( 'Name', 'untitled fit 1' );
h = plot( fitresult, xData, yData );
legend( h, 'N vs. NT', 'untitled fit 1', 'Location', 'NorthEast', 'Interpreter', 'none' );
% Label axes
xlabel( 'NT', 'Interpreter', 'none' );
ylabel( 'N', 'Interpreter', 'none' );
grid on


